package com.weijian.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * 视频上传配置属性类
 * 映射application.yml中的video.upload配置
 */
@Component
@ConfigurationProperties(prefix = "video")
public class VideoProperties {
    
    private Upload upload = new Upload();
    
    public static class Upload {
        /**
         * 最大文件大小
         */
        private String maxSize = "500MB";
        
        /**
         * 允许的文件类型
         */
        private String allowedTypes = "mp4,webm,mov,avi,mkv";
        
        /**
         * 缩略图宽度
         */
        private int thumbnailWidth = 320;
        
        /**
         * 缩略图高度
         */
        private int thumbnailHeight = 180;

        public String getMaxSize() {
            return maxSize;
        }

        public void setMaxSize(String maxSize) {
            this.maxSize = maxSize;
        }

        public String getAllowedTypes() {
            return allowedTypes;
        }

        public void setAllowedTypes(String allowedTypes) {
            this.allowedTypes = allowedTypes;
        }

        public int getThumbnailWidth() {
            return thumbnailWidth;
        }

        public void setThumbnailWidth(int thumbnailWidth) {
            this.thumbnailWidth = thumbnailWidth;
        }

        public int getThumbnailHeight() {
            return thumbnailHeight;
        }

        public void setThumbnailHeight(int thumbnailHeight) {
            this.thumbnailHeight = thumbnailHeight;
        }
    }

    public Upload getUpload() {
        return upload;
    }

    public void setUpload(Upload upload) {
        this.upload = upload;
    }
}